<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Start.aspx.vb" Inherits="MIMS_WRS.Web.Start"%>
<%@ Register TagPrefix="cc" Namespace="MyFramework.Web.UI.WebControls" Assembly="MyFramework.Web" %>
<%@ Register TagPrefix="uc1" TagName="Pager" Src="../UserControls/Pager.ascx" %>
<style>
			#tblList TABLE { BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: whitesmoke }
			#tblList TD { BORDER-TOP: black 0px solid; BORDER-LEFT: #ddd 0px solid; CURSOR: hand }
			#tblList TD { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; WHITE-SPACE: nowrap; TEXT-ALIGN: left }
			TH { PADDING-RIGHT: 2px; PADDING-LEFT: 2px; FONT-SIZE: 11px; WHITE-SPACE: nowrap; TEXT-ALIGN: left }
			#tblList TH { DISPLAY: block; FONT-WEIGHT: normal; FONT-SIZE: 0.9em; OVERFLOW: hidden; BORDER-LEFT: #222 0px solid; COLOR: #3a4f6c; BORDER-BOTTOM: #222 0px solid; FONT-FAMILY: verdana, Arial, tahoma, sans-serif; TEXT-OVERFLOW: ellipsis; BACKGROUND-COLOR: #cfd9e7; TEXT-ALIGN: center }
			#tblList TABLE TBODY TR TD DIV { DISPLAY: block; OVERFLOW: hidden; TEXT-OVERFLOW: ellipsis }
			.ItemRow { BACKGROUND: #f0f0f0 }
			.AlternateItemRow { BACKGROUND: #fafafa }
			.RowSelected { COLOR: #fff; BACKGROUND-COLOR: #9b9b1c }
			.TextBoxNumber { TEXT-ALIGN: right }
			</style>
<cc:masterpage runat="server" templatefile="~/Stock/StockMasterPage.ascx" id="Masterpage1">
	<cc:contentregion id="crContent" runat="server">
		<cc:repeater id="rptList" runat="server">
			<headertemplate>
				<table class="List">
					<thead>
						<tr>
							<th align="left">
								Consolidation Point</th>
							<th align="left">
								Container Loading</th>
							<th align="left">
								Goods (There may not be available stock in every category)</th>
						</tr>
					</thead>
					<tbody>
			</headertemplate>
			<itemtemplate>
				<tr class="ItemRow">
					<td><a href='IMStockReport.aspx?teid=-1&ownerid=-2&showfob=1&cpid=<%# DataBinder.Eval(Container.DataItem, "ConPointID")%>'><%# DataBinder.Eval(Container.DataItem, "Description")%></a></td>
					<td><%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "ContainerLoading"))%></td>
					<td><%# Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Goods"))%></td>
				</tr>
			</itemtemplate>
			<footertemplate>
		</tbody>
		</table>
		</footertemplate>
			<nonetemplate>
				<tr>
					<td colspan="3">
						There is no items.
					</td>
				</tr>
			</nonetemplate>
		</cc:repeater>
		<BR>
		<BR>
		<BR>
		<BR>
		<TABLE class="FormTable" id="tblList">
			<TBODY>
				<TR>
					<TD class="LabelLeft" vAlign="top">
					<table> <tr>
					<td>
						General Enquiry, send us a email
					</td>
					<td></td>
					</tr>
					<tr>
					<td>
					<asp:textbox id="txtGeneralEnquiry" Runat="server" Width="750px" Rows="6" TextMode="MultiLine"></asp:textbox>
					</td>
					<td>
						<table>
						<tr><td>Name</td></tr>
						<tr>
						<td><asp:textbox id="txtName" Runat="server" Width="220px"></asp:textbox></td>
						</tr>
						<tr>
						<td>enter your email address</td>
						</tr>
						<tr><td>
							<asp:textbox id="txtEmailAddr" Runat="server" Width="220px"></asp:textbox>
						</td>
						</tr>
						<tr><td>
							<asp:LinkButton id="lnkSendEmail" runat="server">Click here to send</asp:LinkButton>
						</td></tr>
						</table>
					</td>
					</tr>
					</table>
					</TD>
	</cc:contentregion>
	<cc:contentregion id="pageTitle" runat="server">Select a 
      Consolidation Point to View Stock that is available for immediate delivery 
      from a number of Suppliers <A onclick="ShowGuideInfo(6);" href="#"><IMG src="../Images/info.gif" border="0"></A> 
</TD></TR></TBODY></TABLE></cc:contentregion>
</cc:masterpage>
<script language="javascript" type="text/javascript">
			function openSendEmailGeneralEnquiryDialog() {
			
				if(ValidateEmail() == false)
					{
						return;
					}
				var enquiry = escape(document.getElementById('txtGeneralEnquiry').value);
				var email = escape(document.getElementById('txtEmailAddr').value);
				
				var url = '../Stock/SendEmailGeneralEnquiry.aspx';
				var title = escape('General Enquiry');
				var height = 470;
				var width = 500;
				var iTop = (screen.height-height-30)/2;
				var iLeft = (screen.width/2 -300);
				
				window.showModalDialog('SendEmailGeneralEnquiry.aspx?title=' + title + '&enquiry='+enquiry + '&email=' + email, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; center: no; resizable: no; scroll: no; status: no;');
				
				return false;
			}
			
			function ShowGuideInfo(index)
			{
				var url = '../Stock/DisplayGuidance.aspx?index=' + index ;
				var title = escape('Display guidance');
				var height = 200;
				var width = 500;
				var iTop = (screen.height-height-30)/2;
				var iLeft = (screen.width/2) -100;
				
				 window.showModalDialog('../Dialogs/ShowDialog.aspx?title=' + title + '&src=' + url, '', 'dialogLeft: ' +iLeft+ 'px; dialogTop:' + iTop+ 'px; dialogHeight: ' + height + 'px; dialogWidth: ' + width + 'px; center: no; resizable: no; scroll: no; status: no;');
				return false;
			}
			
			function ValidateEmail()
			{	
				var email = document.getElementById('txtEmailAddr');
				var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
				if (!filter.test(email.value)) {
					alert('Please provide a valid email address.');
					email.focus();
					return false;
				}
				return true;
			}
			
</script>
